home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Directorty Opus 5 - Magellan
/
Opus 5 - Magellan.iso
/
Extras
/
DOPbt2
/
2
/
fileshowV3.1
/
FileShowV3.1
< prev
Wrap
Text File
|
1994-05-31
|
10KB
|
353 lines
/* Optimized with RexxOpt 1.5 */
FileShowVersion="$VER: FileShow 3.1 ()"
signal on syntax
options results
options failat 21
parse arg port
if upper(port)="?" then do
say "USE only from within DOPUS"
say "FileShow V3.0"
say "Lamer Alert! Better read the guide dombo."
exit
end
ScanDirFlag=""
Uno="dest"
Dos="ram:"
call Openfilelist
RescanFlag=0
do v=1 to aantal
SearchFile=SearchFile.v
File=SearchFile.v
Archtype=right(SearchFile.v,3)
call CHECKABORTUS
select
when Archtype="LHA" then Gadgets=Smalltitle||'|'||"COPY"||'|'||Archtype||'|'||"DEL"||'|'||"ex ID"||''
when Archtype="DMS" then Gadgets=SmallTitle||'|'||"COPY"||'|'||Archtype||'|'||"DEL"
when Archtype="LZH" then Gadgets=Smalltitle||'|'||"COPY"||'|'||Archtype||'|'||"DEL"
when Archtype="ZIP" then Gadgets=Smalltitle||'|'||"COPY"||'|'||Archtype||'|'||"DEL"
otherwise Gadgets=Smalltitle||'|'||"COPY"||'|'||Archtype||'|'||"DEL"
end
SelectedFile=TCTC||PathFile||File||TCTC
if exists('T:FILE_ID.DIZ')then address command 'delete T:FILE_ID.DIZ quiet'
if Showtext.v="No FILE_ID.DIZ" then
do
ne||"For "File
SELECT
WHEN ArchType='DMS' THEN ADDRESS command 'dmsdescript > NIL: x T:FILE_ID.diz '||SelectedFile
WHEN ArchType='LHA' THEN ADDRESS command 'lha x > NIL: '||SelectedFile||' FILE_ID.DIZ T:'
WHEN ArchType='LZH' THEN ADDRESS command 'lha x > NIL: '||SelectedFile||' FILE_ID.DIZ T:'
WHEN ArchType='TXT' THEN ADDRESS command 'TxtExtract e > NIL: T:FILE_ID.DIZ '||SelectedFile
WHEN ArchType='DOK' THEN ADDRESS command 'TxtExtract e > NIL: T:FILE_ID.DIZ '||SelectedFile
WHEN ArchType='DOC' THEN ADDRESS command 'TxtExtract e > NIL: T:FILE_ID.DIZ '||SelectedFile
WHEN ArchType='EXE' THEN ADDRESS command 'EXEDescript x > NIL: T:FILE_ID.DIZ '||SelectedFile
WHEN ArchType='ZIP' THEN do
olddirectory=pragma('D','T:')
ADDRESS command 'Unzip > NIL: '||SelectedFile||'FILE_ID.DIZ '
pragma('D',olddirectory)
end
OtherWise break
END
if ~ exists('T:FILE_ID.DIZ')then break
Showtext.v=""
call open('FileID','T:FILE_ID.diz','r')
do until eof('FileID')
Showtext.v=Showtext.v||newline||readln('FileID')
end
call close('FileID')
end
if v<10 then call writech FileShowWindow," "
call writech FileShowWindow,v||"->"||SearchFile.v
do t=length(SearchFile.v)to 12
call writech fileShowWindow,' '
end
call ChoiceWindow
address(port)
if Window=0&ScanDirFlag ~="" then scandir ScanDirFlag ' 1'
if Window=1&ScanDirFlag ~="" then scandir ScanDirFlag ' 0'
if RescanFlag=5 then do
rescan
RescanFlag=0
end
end
address(port)
modify dirflags olddirflags
Rescan
address command wait 1
exit
ChoiceWindow:
if Window=0 then actieresult=rtezrequest(Showtext.v,Gadgets,"",Tag3,actieresult)
else actieresult=rtezrequest(Showtext.v,Gadgets,"",Tag4,actieresult)
select
when actieresult=1 then call Nothing
when actieresult=2 then call Copying
when actieresult=3&Archtype="DMS" then call DMS
when actieresult=3&Archtype="LHA" then call LHA
when actieresult=3&Archtype="LZH" then call LHA
when actieresult=3&Archtype="ZIP" then call ZIP
when actieresult=3 then call Other
when actieresult=4 then call Deleting
when actieresult=0 then call NIELS
end
return
CHECKABORTUS:
checkabort
if result=1 then do
breakresult=rtezrequest("Do You wanna have an abortion","YES|NO","",Tag1,breakresult)
if breakresult=1 then do
call writeln FileShowWindow,"User Abortion"
exit
end
end
return
OpenFilelist:
flag=Exists("Libs:rexxsupport.library")
if flag=0 then do
Say "! ERROR ! Libs:Rexxsupport.Library not Found."
Exit
end
addlib("rexxsupport.library",0,-30)
newline='0a'x
TCTC='"'
flag=Exists("Libs:rexxreqtools.library")
if flag=0 then do
say "! ERROR ! Libs:RexxReqTools.Library not Found."
Exit
end
addlib("rexxreqtools.library",0,-30)
if port='' then port=DOPUS.1
Newshelltext="CON:80/290/505/65/FileShow Control Window/CLOSE/NOSIZE/SCREEN"||port
Outputtext=" >"||TCTC||"CON:50/160/548/141/FileShow Output Window/CLOSE/NOSIZE/SCREEN"||port||TCTC
call open FileShowWindow,Newshelltext
if ~ result then do
say "Open failed .... sukkel"
exit
end
Tag0="rt_reqpos=reqpos_centerscr "
TagL="rt_reqpos=reqpos_topleftscr rt_leftoffset=330 rt_topoffset=100 "
TagR="rt_reqpos=reqpos_topleftscr rt_topoffset=100 "
Tag2=Tag0||"rt_pubscrname="||port
Tag3=TagL||"rt_pubscrname="||port
Tag4=TagR||"rt_pubscrname="||port
SmallTitle="Done"
flag=Show(Ports,port)
if flag=0 then do
ErrorText="ERROR NO.50, Where the Bloody Hell is "port
RC=50
call Syntax
end
address(port)
Uniconify
dopustofront
'getselectedfiles / -1'
Fileshowselects=result
v=0
do forever
positie=index(FileShowselects,'/')
if positie=0 then leave
v=v+1
SearchFile.v=left(FileShowselects,positie-1)
FileShowselects=Delstr(FileShowselects,1,positie)
end
Aantal=v
if aantal=0 then
do
ErrorText="ERROR NO.52, What the Bloody Hell am I looking for ? "
RC=52
call Syntax
end
none
status 3
Window=result
'status 13 -1'
PathFile=result
checkabort
query dirflags
olddirflags=result
if olddirflags<0 then olddirflags=256+olddirflags
if bittst(d2c(olddirflags),5)then do
Modify DIRFLAGS olddirflags-32
end
flag=Exists("modules:rexx/FileShowData")
if flag=0 then do
call writeln FileShowWindow,"! ERROR ! dopus:modules/ext.modules/rexx/FileShowData not Found."
address command
wait 1
Exit
end
call open('list','modules:rexx/FileShowData','r')
y=-1
do until eof('list')
y=y+1
list.y=readln('list')
end
call close('list')
listend=list.0*2
maxaantal=list.0
call writeln FileShowWindow,"Found "||Aantal||" files in Dir ..."||PathFile||""
do w=1 to aantal
SearchFile.w=Upper(SearchFile.w)
call SearchFilename
end
return
syntax:
if rc<49 then ErrorText="Syntax Error" rc"," errortext(rc)"in line" sigl"."i
f rc ~=2 then rtezrequest(Errortext,,"",Tag0)
say errortext
exit
SearchFilename:
Showtext.w="No FILE_ID.DIZ"
do z=1 to listend by 2
if SearchFile.w=list.z then do
s=z+1
u=trunc(list.s/193/maxaantal-38744.5)
d=u//10000
e=(u-d)/10000+d-1
Showtext.w=newline
do x=d to e
Showtext.w=Showtext.w||list.x||newline
end
Iterate
end
end
return
Nothing:
call writeln FileShowWindow," --Didn't do anything"
return
Deleting:
deletetext="Are YOU sure YOU wanna delete"||newline||SelectedFile
deleteGadgets="DELETE IT|DONE"
if Window=0 then delresult=rtezrequest(deletetext,deleteGadgets,"",Tag3,delresult)
else delresult=rtezrequest(deletetext,deleteGadgets,"",Tag4,delresult)
if delresult=1 then do
call writeln FileShowWindow," ->DELETED "
address command
delete SelectedFile quiet
RescanFlag=RescanFlag+1
end
else call writeln FileShowWindow," --Didn't Delete "
return
Copying:
copytext="Where do YOU wanna copy archive to ?"||newline||SelectedFile
copyGadgets="COPY "Uno"|COPY "Dos"|MOVE "Uno"|MOVE "Dos"|"Smalltitle
if Window=0 then copresult=rtezrequest(copytext,copyGadgets,"",Tag3,copresult)
else copresult=rtezrequest(copytext,copyGadgets,"",Tag4,copresult)
if copresult=1 then do
call writeln FileShowWindow," ->Copying to "||Uno
address(port)
'copy' File Uno
end
if copresult=2 then do
call writeln FileShowWindow," ->Copying to "||Dos
address(port)
'copy' File Dos
end
if copresult=3 then do
call writeln FileShowWindow," ->Moving to "||Uno
address(port)
'move' File Uno
RescanFlag=RescanFlag+1
end
if copresult=4 then do
call writeln FileShowWindow," ->Moving to "||Dos
address(port)
'move' File Dos
RescanFlag=RescanFlag+1
end
if copresult=0 then call writeln FileShowWindow," --Didn't Copy or Move anything"
return
DMS:
dmstext="Where do YOU wanna DMS to ?"||newline||SelectedFile
dmsGadgets="DMS DF0:|DMS RAD:|DMS DF1:|DMS DF2:|"Smalltitle
if Window=0 then dmsresult=rtezrequest(dmstext,dmsGadgets,"",Tag3,dmsresult)
else dmsresult=rtezrequest(dmstext,dmsGadgets,"",Tag4,dmsresult)
if dmsresult=1 then do
call writeln FileShowWindow," ->DMS to DF0:"
address command
'dms write' SelectedFile "to DF0: NOTEXT NOPAUSE"||Outputtext
end
if dmsresult=2 then do
call writeln FileShowWindow," ->DMS to RAD:"
address command
if showlist('H','RAD')
then call writeln FileShowWindow," RAD: already mounted"
else do
call writeln FileShowWindow," Mounting RAD:"
'mount RAD: from modules:rexx/FileShowRAD'
end
'dms write' SelectedFile "to RAD: NOTEXT NOPAUSE"||Outputtext
ScanDirFlag="RAD:"
end
if dmsresult=3 then do
call writeln FileShowWindow," ->DMS to DF1:"
address command
'dms write' SelectedFile "to DF1: NOTEXT NOPAUSE"||Outputtext
end
if dmsresult=4 then do
call writeln FileShowWindow," ->DMS to DF2:"
address command
'dms write' SelectedFile "to DF2: NOTEXT NOPAUSE"||Outputtext
end
if dmsresult=0 then call writeln FileShowWindow," --Didn't Dms anything"
if rc ~=0 then do
call writeln FileShowWindow,"[0m DMS ERROR -> "||result
end
return
LHA:
lhatext="Where do YOU wanna "ArchType" to ?"||newline||SelectedFile
lhaGadgets=ArchType" RAM|"Smalltitle
if Window=0 then lharesult=rtezrequest(lhatext,lhaGadgets,"",Tag3,lharesult)
else lharesult=rtezrequest(lhatext,lhaGadgets,"",Tag4,lharesult)
if lharesult=1 then do
call writeln FileShowWindow," ->"ArchType||" to RAM:"
address command
'lha e ' SelectedFile "RAM:"||Outputtext
ScanDirFlag="RAM:"
end
if lharesult=0 then call writeln FileShowWindow," --Didn't "ArchType" anything"
return
ZIP:
ziptext="Where do YOU wanna "ArchType" to ?"||newline||SelectedFile
zipGadgets=ArchType" RAM|"Smalltitle
if Window=0 then zipresult=rtezrequest(ziptext,zipGadgets,"",Tag3,zipresult)
else zipresult=rtezrequest(ziptext,zipGadgets,"",Tag4,zipresult)
if zipresult=1 then do
call writeln FileShowWindow," ->"ArchType||" to RAM:"
address command
olddirectory=pragma('D','RAM:')
'unzip ' SelectedFile||' '||Outputtext
address
pragma('D',olddirectory)
ScanDirFlag="RAM:"
end
if zipresult=0 then call writeln FileShowWindow," --Didn't "ArchType" anything"
return
Other:
othertext="Do YOU wanna DO now?"||newline||SelectedFile
otherGadgets="READ IT|EXECUTE|"Smalltitle
if Window=0 then othresult=rtezrequest(othertext,otherGadgets,"",Tag3,othresult)
else othresult=rtezrequest(othertext,otherGadgets,"",Tag4,othresult)
if othresult=1 then do
call writeln FileShowWindow," ->Read the file "
address(port)
'read' File
busy off
RescanFlag=RescanFlag+1
end
if othresult=2 then do
call writeln FileShowWindow," ->Executing the file "
address(port)
'execute' File
end
if othresult=0 then call writeln FileShowWindow," --Didn't know what to do with"
return
NIELS:
othertext="Extract file_id.diz to "dos" or NOT ?"||newline||SelectedFile
otherGadgets=dos"|"Smalltitle
if Window=0 then othresult=rtezrequest(othertext,otherGadgets,"",Tag3,othresult)
else othresult=rtezrequest(othertext,otherGadgets,"",Tag4,othresult)
if othresult=1 then do
address command
'lha e ' SelectedFile ""file_id.diz" ram:"
ScanDirFlag="RAM:"
end